package genotype;

import evolutionaryLoop.EvolutionaryParameters;

public abstract class BitArrayGenotype extends ArrayGenotype1D<Boolean>{

	public BitArrayGenotype(int length, EvolutionaryParameters parameters) {
		super(Boolean.class, length, parameters); 
		super.setArrayGeno(new Boolean[length]); 
		for (int i = 0; i < length(); i++) {
			set(Math.random()>0.5, i);
		}
	}

	@Override
	public Boolean mutateValue(Boolean value) {
		return !value;
	}

	public String toString(){
		String string = ""; 
		
		for (int i = 0; i < length(); i++) {
			if (get(i)){
				string += "T"; 
			} else {
				string += "F"; 
			}
			
		}
		
		return string; 
	}
}
